home *** CD-ROM | disk | FTP | other *** search
- Path: oxy.rust.net!usenet
- From: ebennett@rust.net
- Newsgroups: comp.lang.c++
- Subject: Re: using const for structs?
- Date: Fri, 19 Jan 1996 03:56:41 GMT
- Organization: Rust Net - High Speed Internet in Detroit 810-642-2276
- Message-ID: <4dmq70$jov@oxy.rust.net>
- References: <4dm36c$c1h@zdi.informatik.uni-stuttgart.de>
- NNTP-Posting-Host: liv-13.rust.net
- X-Newsreader: Forte Free Agent 1.0.82
-
- Gerhard Muth <muth> wrote:
-
- >> Stuff Deleted
-
- >struct box {
- > float width, heigth; // float was int before
- >};
-
- >const box blue_box();
- >const box pink_box(1.0, 4.5); // this is line 35
-
- >void main(void) {}
-
- Add the line:
-
- box(float w, float h) : width(w), heigth(h) {};
-
- to the struct definition, and this should compile OK.
-
- Seems like an omission in the book.
-
- Earl
-
-
-